import java.io.File;

public class FileDelete {
    public static void main( String[] args ) {
        FileDelete m = new FileDelete();
        m.deleteFile();   
    }
     
    public void deleteFile() {
        File f1 = new File( "C:\\Users\\Gulin\\Documents\\111.txt" );
        File f2 = new File( "C:\\Users\\Gulin\\Documents\\111BK.txt" );
         
        if( f1.exists() == true ) {
            System.out.println( "File " + f1.toString() + " exists, deleting." );
            f1.delete();
        }
         
        if( f2.exists() == true ) {
            System.out.println( "File " + f2.toString() + " exists, renaming to flight-_new.txt." );
            f2.renameTo( new File("222") );
        }
    }
}